import { Button, Descriptions } from '@douyinfe/semi-ui';
import { useEffect } from 'react';
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
import { useParams } from 'react-router-dom';
import { IReducerState, IRootReducerState } from '@/store/root-reducer';

const UserDetail = ({
  entity,
  panelVal,
}: {
  entity: any;
  panelVal?: string;
}) => {
  const dispatch = useDispatch<any>();
  useEffect(() => {}, []);

  console.log(entity);

  const params = useParams();
  console.log(params);

  return (
    <>
      {
        {
          info: (
            <div className='flex'>
              <Descriptions className='basis-1/3'>
                <Descriptions.Item itemKey='姓名'>
                  {entity.nameCn}
                </Descriptions.Item>
                <Descriptions.Item itemKey='名称'>
                  {entity.name}
                </Descriptions.Item>
                <Descriptions.Item itemKey='手机号'>
                  {entity.mobile}
                </Descriptions.Item>
                <Descriptions.Item itemKey='用户角色'></Descriptions.Item>
                <Descriptions.Item itemKey='邀请人'></Descriptions.Item>
                <Descriptions.Item itemKey='激活时间'></Descriptions.Item>
              </Descriptions>
              <Descriptions className='basis-1/3'>
                <Descriptions.Item itemKey='用户昵称'>
                  {entity.nickname}
                </Descriptions.Item>
                <Descriptions.Item itemKey='部门'>
                  {entity.dept?.name}
                </Descriptions.Item>
                <Descriptions.Item itemKey='工号'>
                  {entity.username}
                </Descriptions.Item>
                <Descriptions.Item itemKey='状态'>
                  {entity.status}
                </Descriptions.Item>
                <Descriptions.Item itemKey='用户邮箱'>
                  {entity.email}
                </Descriptions.Item>
                <Descriptions.Item itemKey='创建时间'>
                  {entity.createTime}
                </Descriptions.Item>
              </Descriptions>
            </div>
          ),
          application: <>application</>,
        }[panelVal || 'info']
      }
    </>
  );
};

export default UserDetail;
